package cc.vicp.djx314.starfood.domain.order;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;

import org.hibernate.validator.constraints.NotBlank;

import cc.vicp.djx314.starfood.domain.account.Personnel;
import cc.vicp.djx314.starfood.domain.account.User;

public class Order implements Serializable {
	/**
	 * 
	 */
	private static final long serialVersionUID = -1494961210752787471L;
	private Integer id;  //自增主键

	@NotBlank(message = "收货人姓名不能为空")
	private String custName;  //收货人姓名

	private Date time;  //下订时间

	@NotBlank(message = "地址不能为空")
	private String address;  //下订人的地址

	@NotBlank(message = "联系电话不能为空")
	private String phone;  //下订人的联系电话

	private Double sum;  //该订单总金钱

	private User user;  //订单对应的user

	private List<OrderDish> orderDishes = new ArrayList<OrderDish>();  //菜式和订单的关联表

	private boolean orderEnabled;  //该订单是否已经生效

	private boolean orderCancled;  //该订单是否已经取消
	/**
	 * 订单状态,0为没有;1为已确认,正在制作;2为已经出货;3为已经签收,订单结束
	 */
	private int orderStatus = 0;

	/**
	 * 完结订单的服务员
	 */
	private Personnel personnel;

	public Order() {
		super();
	}

	public Integer getId() {
		return id;
	}
	public void setId(Integer id) {
		this.id = id;
	}
	public String getCustName() {
		return custName;
	}
	public void setCustName(String custName) {
		this.custName = custName;
	}
	public Date getTime() {
		return time;
	}
	public void setTime(Date time) {
		this.time = time;
	}
	public String getAddress() {
		return address;
	}
	public void setAddress(String address) {
		this.address = address;
	}
	public String getPhone() {
		return phone;
	}
	public void setPhone(String phone) {
		this.phone = phone;
	}
	public Double getSum() {
		return sum;
	}
	public void setSum(Double sum) {
		this.sum = sum;
	}
	public User getUser() {
		return user;
	}
	public void setUser(User user) {
		this.user = user;
	}
	public List<OrderDish> getOrderDishes() {
		return orderDishes;
	}
	public void setOrderDishes(List<OrderDish> orderDishes) {
		this.orderDishes = orderDishes;
	}
	public boolean getOrderEnabled() {
		return orderEnabled;
	}
	public void setOrderEnabled(boolean orderEnabled) {
		this.orderEnabled = orderEnabled;
	}
	public boolean getOrderCancled() {
		return orderCancled;
	}
	public void setOrderCancled(boolean orderCancled) {
		this.orderCancled = orderCancled;
	}
	public int getOrderStatus() {
		return orderStatus;
	}
	public void setOrderStatus(int orderStatus) {
		this.orderStatus = orderStatus;
	}
	public Personnel getPersonnel() {
		return personnel;
	}
	public void setPersonnel(Personnel personnel) {
		this.personnel = personnel;
	}
}